#!/bin/bash
echo "测试后端API连接..."
echo ""
echo "1. 测试健康检查:"
curl -s http://localhost:3001/health | jq . || curl -s http://localhost:3001/health
echo ""
echo ""
echo "2. 测试登录接口:"
curl -s -X POST http://localhost:3001/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin123"}' | jq -r '.access_token' | head -c 50
echo ""
echo ""
echo "3. 检查前端代理配置..."
echo "前端应在 http://localhost:3000"
echo "后端应在 http://localhost:3001"
